import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
import path from "node:path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue({
      template: { transformAssetUrls }
    }),
    quasar({
      sassVariables: 'src/quasar-variables.sass'
    }),
    Pages({
      // 这里可以配置插件选项，例如路由的目录等,这里我指定了遍历的文件夹是src/view目录
      dirs: [
        { dir: 'src/views', baseRoute: '' },
        // features dir for pages
        // { dir: 'src/views/main', baseRoute: 'main' },
        // with custom file pattern
      ],
      // extendRoute(route, parent) {
      //   // 这里可以对路由进行额外的处理，比如添加meta信息等
      //   return route
      // },
    }),
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
  server: {
    host: '0.0.0.0',
    port: 8010,
    proxy: {},
  },
})
